/* calculator with AST */

%{
#include <stdio.h>
#include <stdlib.h>
%}

%token EOL NUMBER

%left '+' '-'
%left '*' '/'

%%

calclist: /* nothing */
				| calclist exp EOL 
				| calclist EOL
				;

exp: exp '+' exp
	 | exp '-' exp
   | exp '*' exp
	 | exp '/' exp
	 | '(' exp ')'
	 | NUMBER
	 ;

%%
